import {defineStore} from "pinia";
import {reactive} from "vue";
import * as loginService from './LoginService.ts';

export const useLoginStore = defineStore('loginStore', () => {
    const formData = reactive({
        username: 'admin',
        password: 'admin123'
    });

    async function submit() {
        const username = formData.username;
        const password = formData.password;
        const res = await loginService.login(username, password);
        if (res) {
            // 登录成功
        } else {
            // 登录失败
        }

    }

    return {
        formData,
        submit
    }
});